/* GUI CONVERTED from reoprp18.p (converter v1.75) Fri Sep  1 15:54:21 2000 */
/* reoprp18.p - REPETITIVE OPERATIONS BY EMPLOYEE REPORT*/
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/*F0PN*/ /*K0Z3*/ /*                                                    */
/*V8:ConvertMode=FullGUIReport                                 */
/* REVISION: 1.0      LAST MODIFIED: 05/12/86   BY: PML */
/* REVISION: 2.0      LAST MODIFIED: 05/21/87   BY: EMB */
/* REVISION: 2.1      LAST MODIFIED: 10/20/87   BY: WUG *A94**/
/* REVISION: 4.0      LAST MODIFIED: 02/17/88   BY: RL  *A171**/
/* REVISION: 4.0      LAST MODIFIED: 02/24/88   BY: WUG *A175**/
/* REVISION: 4.0      LAST MODIFIED: 08/26/88   BY: flm *A411**/
/* REVISION: 5.0      LAST MODIFIED: 03/28/89   BY: EMB */
/* REVISION: 7.2      LAST MODIFIED: 11/23/94   BY: cpp *FT95**/
/* REVISION: 8.6      LAST MODIFIED: 10/14/97   BY: bvm *K0Z3**/

/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan       */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 05/03/00   BY: *N09M* Inna Lyubarsky   */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KP* myb              */
/* REVISION: 9.1      LAST MODIFIED: 09/01/00   BY: *N0R1* Jean Miller      */

/*K0Z3*/ /* DISPLAY TITLE */

/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

/*K0Z3*/ {mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */
/*N09M* ----- DELETED TRANSLATABLE STRINGS DEFINITIONS ------- *
* &SCOPED-DEFINE reoprp18_p_1 "Total:"
* /* MaxLen: Comment: */
*
* &SCOPED-DEFINE reoprp18_p_2 "Shift:"
* /* MaxLen: Comment: */
*
* &SCOPED-DEFINE reoprp18_p_3 "  Report"
* /* MaxLen: Comment: */
*
* &SCOPED-DEFINE reoprp18_p_4 "Date: "
* /* MaxLen: Comment: */
*
* &SCOPED-DEFINE reoprp18_p_5 "Employee: "
* /* MaxLen: Comment: */
*N09M* ----------------------------------------------------- */
/* ********** End Translatable Strings Definitions ********* */

     define variable wkctr     like op_wkctr.
     define variable wkctr1    like op_wkctr.
     define variable mch       like op_mch.
     define variable mch1      like op_mch.
     define variable old_part  like op_part.
     define variable emp       like op_emp.
     define variable emp1      like op_emp.
     define variable part      like op_part.
     define variable part1     like op_part.
     define variable opdate    like op_date.
     define variable opdate1   like op_date.
     define variable old_date  as date.
     define variable shift     like op_shift.

/*K0Z3* *moved up*
 *   /* DISPLAY TITLE */
 *   {mfdtitle.i "b+ "}
 *K0Z3*/

     
/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
        
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
emp       colon 20      emp1      label {t001.i} colon 49
        part      colon 20      part1     label {t001.i} colon 49
        opdate    colon 20      opdate1   label {t001.i} colon 49
        wkctr     colon 20      wkctr1    label {t001.i} colon 49
        mch       colon 20      mch1      label {t001.i} colon 49
        shift     colon 20
        skip
      SKIP(.4)  /*GUI*/
with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



     /* SET EXTERNAL LABELS */
     setFrameLabels(frame a:handle).

/*K0Z3*/ {wbrp01.i}

         
/*GUI*/ {mfguirpa.i true  "printer" 132 }

/*GUI repeat : */
/*GUI*/ procedure p-enable-ui:

        old_part = ?.
        old_date = ?.
        if wkctr1 = hi_char then wkctr1 = "".
        if mch1 = hi_char then mch1 = "".
        if opdate = low_date then opdate = ?.
        if opdate1 = hi_date then opdate1 = ?.
        if emp1 = hi_char then emp1 = "".
        if part1 = hi_char then part1 = "".

/*K0Z3*/    if c-application-mode <> 'web' then
            
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


/*K0Z3*/ {wbrp06.i &command = update &fields = "  emp emp1 part part1 opdate
          opdate1 wkctr wkctr1 mch mch1 shift" &frm = "a"}

/*K0Z3*/ if (c-application-mode <> 'web') or
/*K0Z3*/ (c-application-mode = 'web' and
/*K0Z3*/ (c-web-request begins 'data')) then do:

        bcdparm = "".
        {mfquoter.i emp    }
        {mfquoter.i emp1   }
        {mfquoter.i part   }
        {mfquoter.i part1  }
        {mfquoter.i opdate }
        {mfquoter.i opdate1}
        {mfquoter.i wkctr  }
        {mfquoter.i wkctr1 }
        {mfquoter.i mch    }
        {mfquoter.i mch1   }
        {mfquoter.i shift  }

        if wkctr1 = "" then wkctr1 = hi_char.
        if mch1 = "" then mch1 = hi_char.
        if opdate = ? then opdate = low_date.
        if opdate1 = ? then opdate1 = hi_date.
        if emp1 = "" then emp1 = hi_char.
        if part1 = "" then part1 = hi_char.

/*K0Z3*/ end.

        /* SELECT PRINTER  */
            
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i  "printer" 132}
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:



        {mfphead.i}

        if shift > "" then do:
/*N09M    form header {&reoprp18_p_2} shift */
/*N09M*/  FORM /*GUI*/  header getTermLabelRtColon("SHIFT",11) format "x(11)" shift
           with STREAM-IO /*GUI*/  frame shift width 132 no-attr-space page-top.
           view frame shift.
    end.

        for each op_hist where (op_wkctr >= wkctr and op_wkctr <= wkctr1)
        and (op_mch >= mch and op_mch <= mch1)
        and (op_date >= opdate and op_date <= opdate1)
        and (op_emp >= emp and op_emp <= emp1)
        and (op_part >= part and op_part <= part1)
        and (op_shift = shift or shift = "")
        use-index op_date no-lock break
        by op_emp by op_date by op_part by op_wo_op
        by op_wkctr by op_mch by op_trnbr
        with frame b width 132 no-attr-space:

           /* SET EXTERNAL LABELS */
/*N0R1*    setFrameLabels(frame a:handle). */
/*N0R1*/   setFrameLabels(frame b:handle).

           if op_emp <> old_part then do:
          if page-size - line-counter < 4 then page.
          display with frame b STREAM-IO /*GUI*/ .
/*N09M    put {&reoprp18_p_5} op_emp. */
/*N09M*/  put
      {gplblfmt.i
      &FUNC=getTermLabel(""EMPLOYEE"",16)
      &CONCAT="': '"
      } op_emp.
          find emp_mstr where emp_addr = op_emp no-lock no-error.
          if available emp_mstr then
          put " " emp_fname + " " + emp_lname format "x(40)".
          old_part = op_emp.
           end.

           if op_date <> old_date then do:
          if page-size - line-counter < 3 then page.
          display with frame b STREAM-IO /*GUI*/ .
/*N09M    put {&reoprp18_p_4} op_date skip. */
/*N09M*/  put
      {gplblfmt.i
      &FUNC=getTermLabel(""DATE"",8)
      &CONCAT="': '"
      } op_date skip.
          old_date = op_date.
           end.

           display space(4) op_part op_wo_op op_wkctr op_mch
          op_qty_comp op_qty_rjct op_qty_rwrk op_act_setup op_act_run
/*FT95*           op_trnbr. */
/*FT95*/          op_trnbr format ">>>>>>>9" WITH STREAM-IO /*GUI*/ .

           accumulate op_qty_comp (total by op_emp).
           accumulate op_qty_rjct (total by op_emp).
           accumulate op_qty_rwrk (total by op_emp).
           accumulate op_act_setup (total by op_emp).
           accumulate op_act_run (total by op_emp).

           if last-of (op_emp) then do:
          if page-size - line-counter < 2 then page.
          else do:
             down 1.
             display
/*FT95* REDUCED SEVERAL FIELD SIZES TO MAKE ROOM FOR INCREASE IN op_trnbr */
/*FT95*                 fill("-",15) format "x(15)" @ op_qty_comp */
/*FT95*/                fill("-",14) format "x(14)" @ op_qty_comp
/*FT95*                 fill("-",15) format "x(15)" @ op_qty_rjct */
/*FT95*/                fill("-",14) format "x(14)" @ op_qty_rjct
/*FT95*                 fill("-",15) format "x(15)" @ op_qty_rwrk */
/*FT95*/                fill("-",14) format "x(14)" @ op_qty_rwrk
            fill("-",14) format "x(14)" @ op_act_setup
            fill("-",12) format "x(12)" @ op_act_run WITH STREAM-IO /*GUI*/ .
          end.
          down 1.
          display
/*N09M       {&reoprp18_p_1} @ op_mch */
/*N09M*/     getTermLabelRtColon("TOTAL",8) @ op_mch
             accum total by op_emp op_qty_comp @ op_qty_comp
             accum total by op_emp op_qty_rjct @ op_qty_rjct
             accum total by op_emp op_qty_rwrk @ op_qty_rwrk
             accum total by op_emp op_act_setup @ op_act_setup
             accum total by op_emp op_act_run @ op_act_run WITH STREAM-IO /*GUI*/ .
          old_part = ?.
          old_date = ?.
           end.

           if last (op_emp) then do:
          if page-size - line-counter < 3 then page.
          else do:
             down 2.
             display
/*FT95* REDUCED SEVERAL FIELD SIZES TO MAKE ROOM FOR INCREASE IN op_trnbr */
/*FT95*                 fill("-",15) format "x(15)" @ op_qty_comp */
/*FT95*/                fill("-",14) format "x(14)" @ op_qty_comp
/*FT95*                 fill("-",15) format "x(15)" @ op_qty_rjct */
/*FT95*/                fill("-",14) format "x(14)" @ op_qty_rjct
/*FT95*                 fill("-",15) format "x(15)" @ op_qty_rwrk */
/*FT95*/                fill("-",14) format "x(14)" @ op_qty_rwrk
            fill("-",14) format "x(14)" @ op_act_setup
            fill("-",12) format "x(12)" @ op_act_run WITH STREAM-IO /*GUI*/ .
          end.
          down 1.
          display
/*N09M       {&reoprp18_p_3} @ op_wkctr */
/*N09M*/     getTermLabel("REPORT",8) @ op_wkctr
/*N09M       {&reoprp18_p_1} @ op_mch */
/*N09M*/     getTermLabelRtColon("TOTAL",8) @ op_mch
             accum total op_qty_comp @ op_qty_comp
             accum total op_qty_rjct @ op_qty_rjct
             accum total op_qty_rwrk @ op_qty_rwrk
             accum total op_act_setup @ op_act_setup
             accum total op_act_run @ op_act_run WITH STREAM-IO /*GUI*/ .
           end.

           /* END SECTION */
           
/*GUI*/ {mfguirex.i } /*Replace mfrpexit*/


        end.

        hide frame shift.

        /* REPORT TRAILER */
        
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/


     end.

/*K0Z3*/ {wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" emp emp1 part part1 opdate opdate1 wkctr wkctr1 mch mch1 shift "} /*Drive the Report*/
